{template header}

<link href="{SITE_URL}public/bootstrap-datetimepicker/bootstrap-datetimepicker.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="{SITE_URL}public/bootstrap-datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="{SITE_URL}public/bootstrap-datetimepicker/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>


<div class="container">


<ol class="breadcrumb">
  <li><a href="{SITE_URL}">首页</a></li>
  <li><a href="{tsUrl('plan')}">方案</a></li>
  <li><a href="{tsUrl('plan','show',array('id'=>$strPlan[planid]))}">{$strPlan['title']}</a></li>
  <li class="active">修改方案</li>
</ol>



<div class="panel panel-default">
  <div class="panel-body">
  



<div class="row">
  <div class="col-md-2"></div>
  <div class="col-md-8">
  
  <form id='form1' method="POST" action="{SITE_URL}index.php?app=plan&ac=edit&ts=basedo"  enctype="multipart/form-data">

  <div class="form-group">
    <label>名称：</label>
    <input name="title" type="text" class="form-control" value="{$strPlan['title']}">
  </div>
  
  
 {if $arrType} 
  <div class="form-group">
    <label>类型：</label>

<select class="form-control" name="typeid">
{loop $arrType $key $item}
<option value="{$item[typeid]}" {if $item[typeid]==$strPlan[typeid]}selected="select"{/if}>{$item[typename]}</option>
{/loop}
</select>
  </div>
  
  {/if}

    <div class="form-group">
      <label>方案详情：</label>
      <div id="tseditor">{$strPlan[content]}</div>
      <div style="display: none;">
        <textarea id="content" name="content">{$strPlan[content]}</textarea>
      </div>
      <!--<textarea name="content" id="tseditor"></textarea>-->

    </div>

  
  

  <!--
  <div class="form-group">
    <label>方案海报：</label>
	
{if $strPlan['photo']}
<p><img src="{php echo tsXimg($strPlan['photo'],'plan','300','200',$strPlan['path'])}" /></p>
{/if}
	
    <input type="file" name="photo" />
  </div>
  -->
  
<input type="hidden" name="planid" value="{$strPlan[planid]}" />
  <input class="btn btn-success" type="submit" value="修改方案">  <a href="{tsUrl('plan','show',array('id'=>$strPlan[planid]))}">返回</a>
  
</form>

</div>
</div>


</div>
</div>
</div>

{php doAction('tseditor')}

<script>
  $(function(e){
    $('#form1').on('submit', function(e) {
      var title  = $('#title').val();
      var content  = $('#content').val();


      if(title==''){
        bootbox.alert('名称必填');
        return false;
      }

      if (content == '<p><br></p>') {
        bootbox.alert('内容不能为空');
        return false;
      }

    });



    function insertGps(dd){
    $('#gps').val(dd);
    $('#myModal').modal('hide');
  }
  function openmap(){
    tsNotice('<iframe frameborder="0" scrolling="no" width="100%" height="400" src="{SITE_URL}index.php?app=plan&ac=add&ts=map"></iframe>');
  }



  $('#limitTime').datetimepicker({
    language:  'zh-CN',
    format: 'yyyy-mm-dd hh:ii'
  });
</script>
{template footer}